t = int(input())
for _ in range(t):
    n = int(input())
    if n == 1 or n == 2:
        print(0)
    elif n % 2 != 0:
        print(3 * (n - 3) // 2 + 2)
    else:
        print(3 * (n - 2) // 2)